﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Mg.ExpressionParser
{
    public class BaseExpressionParser<T> : IExpressionParser where T : Expression
    {
        protected virtual SqlPack Update(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Update方法");
        }
        protected virtual SqlPack Select(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Select方法");
        }
        protected virtual SqlPack Join(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Join方法");
        }
        protected virtual SqlPack Where(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Where方法");
        }
        protected virtual SqlPack In(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.In方法");
        }
        protected virtual SqlPack GroupBy(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.GroupBy方法");
        }
        protected virtual SqlPack OrderBy(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.OrderBy方法");
        }
        protected virtual SqlPack Max(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Max方法");
        }
        protected virtual SqlPack Min(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Min方法");
        }
        protected virtual SqlPack Avg(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Avg方法");
        }
        protected virtual SqlPack Count(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Count方法");
        }
        protected virtual SqlPack Sum(T expression, SqlPack sqlPack)
        {
            throw new NotImplementedException("未实现" + typeof(T).Name + "Parser.Sum方法");
        }


        public SqlPack Avg(Expression expression, SqlPack sqlPack)
        {
            return Avg((T)expression, sqlPack);
        }

        public SqlPack Count(Expression expression, SqlPack sqlPack)
        {
            return Count((T)expression, sqlPack);
        }

        public SqlPack GroupBy(Expression expression, SqlPack sqlPack)
        {
            return GroupBy((T)expression, sqlPack);
        }

        public SqlPack In(Expression expression, SqlPack sqlPack)
        {
            return In((T)expression, sqlPack);
        }

        public SqlPack Join(Expression expression, SqlPack sqlPack)
        {
            return Join((T)expression, sqlPack);
        }

        public SqlPack Max(Expression expression, SqlPack sqlPack)
        {
            return Max((T)expression, sqlPack);
        }

        public SqlPack Min(Expression expression, SqlPack sqlPack)
        {
            return Min((T)expression, sqlPack);
        }

        public SqlPack OrderBy(Expression expression, SqlPack sqlPack)
        {
            return OrderBy((T)expression, sqlPack);
        }

        public SqlPack Select(Expression expression, SqlPack sqlPack)
        {
            return Select((T)expression, sqlPack);
        }

        public SqlPack Sum(Expression expression, SqlPack sqlPack)
        {
            return Sum((T)expression, sqlPack);
        }

        public SqlPack Update(Expression expression, SqlPack sqlPack)
        {
            return Update((T)expression, sqlPack);
        }

        public SqlPack Where(Expression expression, SqlPack sqlPack)
        {
            return Where((T)expression, sqlPack);
        }
    }
}
